]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
lookingGlass: Throw a clearer error on referencing invalid result index
authorMarco Trevisan (Treviño) <mail@3v1n0.net>
Mon, 20 May 2019 21:27:48 +0000 (23:27 +0200)
committerFlorian Müllner <florian.muellner@gmail.com>
Mon, 9 Sep 2019 19:28:18 +0000 (19:28 +0000)
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/700

js/ui/lookingGlass.js

index a53fd90db7bf52fedc0cf77c3d479c18765b1991..2c1239cd5f86de76da2f4359eca57432eba21e37 100644 (file)
@@ -1010,7 +1010,11 @@ var LookingGlass = class LookingGlass {
     }
 
     getResult(idx) {
-        return this._results[idx - this._offset].o;
+        try {
+            return this._results[idx - this._offset].o;
+        } catch (e) {
+            throw new Error(`Unknown result at index ${idx}`);
+        }
     }
 
     toggle() {